import request from '@/utils/request'

// 查询指标列表
export function getNameList() {
  return request({
    url: '/performance/examine/page/list',
    method: 'get'
  })
}

// 查询部门(组织)下用户
export function getUser() {
    return request({
      url: '/system/user/deptTree/getUser',
      method: 'get'
    })
}

// 查询指标列表
export function getIndicatorsList() {
    return request({
      url: '/performance/indicators/name/list',
      method: 'get'
    })
}

// 修改指标
export function updateTargetName(data) {
    return request({
      url: '/performance/indicators/update',
      method: 'put',
      data: data
    })
}

// 删除指标
export function deleteTarget(id) {
    return request({
      url: `/performance/indicators/delete/${id}`,
      method: 'delete',
    })
}

// 新增指标
export function addTarget(data) {
    return request({
      url: `/performance/indicators/add`,
      method: 'post',
      data: data
    })
}

// 新增绩效考核
export function addTargetExamine(data) {
    return request({
      url: `/performance/examine/add`,
      method: 'post',
      data: data
    })
}

// 删除绩效考核
export function deleteTargetExamine(id) {
  return request({
    url: `/performance/examine/delete/${id}`,
    method: 'delete'
  })
}

// 获取绩效考核详情
export function getDetailData(id) {
  return request({
    url: `/performance/examine/get/${id}`,
    method: 'get'
  })
}

// 修改绩效考核
export function updateData(data) {
  return request({
    url: `/performance/examine/update`,
    method: 'put',
    data: data
  })
}

// 下载
export function exportData() {
  return request({
    url: `/performance/examine/export`,
    method: 'post'
  })
}